package com.ruoyi.residentsqr.controller;




import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.pojo.TbDocumentTypes;
import com.ruoyi.pojo.TbResidentTypes;
import com.ruoyi.pojo.TbResidents;
import com.ruoyi.residentsqr.mapper.TbDocumentTypesMapper;
import com.ruoyi.residentsqr.residentqrDto.ResidentsDto;
import com.ruoyi.residentsqr.residentsqrVo.ResidentsVo;
import com.ruoyi.residentsqr.service.TbDocumentTypesService;
import com.ruoyi.residentsqr.service.TbResidentTypesService;
import com.ruoyi.residentsqr.service.TbResidentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/residentsqr")
public class TbResidentsController {

    @Autowired
    private TbResidentsService tbResidentsService;

    @Autowired
    private TbResidentTypesService tbResidentTypesService;

    @Autowired
    private TbDocumentTypesService tbDocumentTypesService;


    //住户确定查询页面
    @PostMapping("findPage")
    public Page<ResidentsVo> findPage(ResidentsDto residentsDto){

        return tbResidentsService.findPage(residentsDto);
    }


    //住户类型
    @GetMapping("findResidentTypes")
    public List<TbResidentTypes> findResidentTypes(){
        return tbResidentTypesService.list();
    }


    //证件类型
    @GetMapping("findDocumentTypes")
    public List<TbDocumentTypes> findDocumentTypes(){
        return tbDocumentTypesService.list();
    }


    //详情审核
    @GetMapping("getById/{id}")
    public ResidentsVo getById(@PathVariable("id") Integer id){
        return tbResidentsService.getId(id);
    }

    //详情审核的确定按钮
    @PostMapping("updateresidentsqr")
    public void updateresidentsqr(ResidentsVo residentsVo){
        tbResidentsService.updateresidentsqr(residentsVo);
    }





}
